package itheima.com.myreflect5;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ReflectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
        Class clazz = Class.forName("itheima.com.myreflect5.Student");
        Method fun4 = clazz.getMethod("fun4", String.class);

        Student student = (Student) clazz.newInstance();
        Object invoke = fun4.invoke(student,"ge");
        System.out.println(invoke);

    }
}
